import Vue from 'vue'
import VueRouter from 'vue-router'
import axios from 'axios'
import VueAxios from 'vue-axios'
import Mint from 'mint-ui';
import 'mint-ui/lib/style.css';
import '../../assets/less/base.less'


import Index from './index.vue'
import matchList from './views/matchList.vue'
import matchInfo from './views/matchInfo.vue'
import matchDetail from './views/matchDetail.vue'

import * as filters from './filters/index.js'

Vue.use(VueRouter);
Vue.use(VueAxios, axios);
Vue.use(Mint);

axios.defaults.baseURL = 'http://api.wangyuhudong.com/';
Vue.config.productionTip = false

// 注册全局的过滤器
Object.keys(filters).forEach(key => {
    Vue.filter(key, filters[key])
})

const routes = [
    { path: '/matchList', component: matchList },
    { path: '/matchInfo', component: matchInfo },
    { path: '/matchDetail', component: matchDetail },
    { path: '*', redirect: '/matchList' }

]

const router = new VueRouter({
    routes
});

var app = new Vue({
    el: '#app',
    router,
    render: h => h(Index)
})